- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.1k
Feat/issue 4899 simplify alignment for column geoms #4921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/issue 4899 simplify alignment for column geoms #4921
Conversation
| 
 Thanks, done now. I was puzzling about why the diff was showing all files as changed! | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks almost good. Random comments:
- I think we should add at least one example to show how justworks briefly.
- When used with some positions (e.g. position_dodge()), non-defaultjustmight result in a bit weird look. I'm wondering if we can add some friendly note about this.
Co-authored-by: Hiroaki Yutani <[email protected]>
…ttps://github.com/wurli/ggplot2 into feat/issue-4899-simplify-alignment-for-column-geoms
| 
 Both of these are now complete. The friendly note is in the documentation for the  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The friendly note looks good. Sorry, I failed to catch some more minor points. Also, could you resolve the conflict on NEWS.md?
| 
 I can't remember the reason why  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! No further comments from my side.
@thomasp85
Could you also take a brief look when you have time?
| LGTM | 
| Thanks for reviewing! | 

This PR adds a
justargument togeom_col()andgeom_bar()(#4899) allowing a user to more easily change the alignment of columns. In particular, it makes it easy to align the sides of columns with axis breaks in cases where theresolution()of the data is not trivial to calculate.justis used rather thanhjust. This has a downside that it breaks with thehjust/vjustpattern used elsewhere in ggplot2, however it seems preferable sincehjustwould necessitatevjustfor horizontal columns, which would raise difficult questions about whether to modify other behaviour, e.g. ofhas_flipped_aes().widthargument - resolution of the data now reads asresolution()of the data to more clearly hint at what's happening under the hoodxminandyminforgeom_col()Here's how to use the
justargument:Created on 2022-07-26 by the reprex package (v2.0.1)